<?php echo form_open(uri_string(), 'class="crud" id="personal-info-form"'); ?>
<?php echo form_hidden('escort_id', $escort->getId()) ?>
<fieldset>
	<ul id="personal-content" class="ui-sortable form_inputs">
		<li class="" id="header">
			<label for="header">&nbsp;</label>
			<div class="input type-text three-column">
				<div class="three-column-first">
					&nbsp;
				</div>
				<div class="three-column-second">
				<?php echo lang('escort_be_escort_public_label')?>
				</div>
				<div class="three-column-third">
				<?php echo lang('escort_be_escort_locked_label')?>
				</div>
			</div>
		</li>
		<li class="" id="personal_visit">
			<label for="site_name"><?php echo lang('escort_be_escort_personal_sex_label')?></label>
			<div class="input type-text three-column">
				<div class="three-column-first">
				<?php echo form_dropdown('sex', getSexOptionData_ioc(), $escort->getSex() , 'id="personal_info_sex_id" class="custom"' );?>
				</div>
				<div class="three-column-second">
				<?php echo form_checkbox('public_sex', 1, $escort->getPublicSex(), 'class="escort-checkbox"')?>
				</div>
				<div class="three-column-third">
				<?php echo form_checkbox('locked_sex',1,$lockedEscort->getLockedSex(), 'class="escort-checkbox"')?>
				</div>
			</div>
		</li>
		<!-- 
		<li class="" id="female_info">
			<label for="site_name"><?php echo lang('escort_be_escort_personal_info_breasts_size')?></label>
			<div class="input type-text three-column">
				<div class="three-column-first">
				<?php echo form_dropdown('personal_info_breasts_size_id', getBreastsSizeOptionData_ioc(), array($escort->getBreastsSizeId()) , 'id="personal_info_breasts_size_id" class="custom"' );?>
				</div>
				<div class="three-column-second">
				<?php echo form_checkbox('public_breasts_size', 1, $escort->getPublicBreastsSize(), 'class="escort-checkbox"')?>
				</div>
				<div class="three-column-third">
				<?php //echo form_checkbox('locked_breasts_size',1,$lockedEscort->getLockedBreastsSize(), 'class="escort-checkbox"')?>
				</div>
			</div>
		</li>
		<li class="" id="male_info">
			<label for="site_name"><?php echo lang('escort_be_escort_personal_info_penis_size')?></label>
			<div class="input type-text three-column">
				<div class="three-column-first">
				<?php echo form_dropdown('personal_info_penis_size_id', getPenisSizeOptionData_ioc(), array($escort->getPenisSizeId()) , 'id="personal_info_penis_size_id" class="custom"' );?>
				</div>
				<div class="three-column-second">
				<?php echo form_checkbox('public_penis_size', 1, $escort->getPublicPenisSize(), 'class="escort-checkbox"')?>
				</div>
				<div class="three-column-third">
				<?php //echo form_checkbox('locked_penis_size',1,$lockedEscort->getLockedPenisSize(), 'class="escort-checkbox"')?>
				</div>
			</div>
		</li>
		 -->
		<li class="" id="personal_position">
			<label for="site_name"><?php echo lang('escort_be_escort_personal_orientation_label')?></label>
			<div class="input type-text three-column">
				<div class="three-column-first">
				<?php echo form_dropdown('sexual_orientation_id', getSexualOrientationData_ioc(), array($escort->getSexualOrientationId()) , 'id="sexual_orientation_id" class="custom"' );?>
				</div>
				<div class="three-column-second">
				<?php echo form_checkbox('public_sexual_orientation', 1, $escort->getPublicSexualOrientation(), 'class="escort-checkbox"')?>
				</div>
				<div class="three-column-third">
				<?php echo form_checkbox('locked_sexual_orientation',1,$lockedEscort->getLockedSexualOrientation(), 'class="escort-checkbox"')?>
				</div>
			</div>	
		</li>
		<li class="" id="personal_contact_data">
			<label for="escort_birthday"><?php echo lang('escort_be_escort_personal_birthday_label')?></label>
			<div class="input type-text three-column">
				<div class="three-column-first">
				<input class="text-box" type="text" value="<?php echo $escort->getBirthDate() ? sysDateFormat($escort->getBirthDate(), DATE_FORMAT):'';?>" name="birth_date" id="birth_date" />
				</div>
				<div class="three-column-second">
				<?php echo form_checkbox('public_birth_date', 1, $escort->getPublicBirthDate(), 'class="escort-checkbox" id="public_birth_date"')?>
				</div>
				<div class="three-column-third">
				<?php echo form_checkbox('locked_birth_date',1,$lockedEscort->getLockedBirthDate(), 'class="escort-checkbox"')?>
				</div>
			</div>
		</li>
		<li class="" id="personal_current_services">
			<label for="escort_birthday"><?php echo lang('escort_be_escort_personal_languages_label')?></label>
			<div class="input type-text three-column">
				<div class="three-column-first">
				<?php
				$language_array = array_filter( explode(',',$escort->getLanguageIds()) );
				?>
				<?php
				$languageList =  getLanguagesOptionData_ioc();
				if(count($languageList)> 0){
					foreach ($languageList as $key => $value){
				?>
					<div class="checkbox-wrapper">
				<?php
						echo form_checkbox('languages['.$key.']', $key, in_array($key, $language_array));
				?>
						<label><?php echo $value?></label>
					</div>
				<?php
					}
				}
				?>
				<?php //echo multi_checkbox('languages[]', getLanguagesOptionData_ioc(), $language_array, "style='width:108px;height:100px;float:left;overflow:auto;'");?>
				</div>
				<div class="three-column-second">
				<?php echo form_checkbox('public_language_ids', 1, $escort->getPublicLanguageIds(), 'class="escort-checkbox"')?>
				</div>
				<div class="three-column-third">
				<?php echo form_checkbox('locked_language_ids',1,$lockedEscort->getLockedLanguageIds(), 'class="escort-checkbox"')?>
				</div>
			</div>
		</li>
		<li class="" id="personal_last_payment">
			<label for="escort_birthday"><?php echo lang('escort_be_escort_personal_country_label')?></label>
			<div class="input type-text three-column">
				<div class="three-column-first">
				<?php echo form_dropdown('country_id', getCountryData_ioc(), array($escort->getCountryId()), 'id="country_id" class="custom"');?>
				</div>
				<div class="three-column-second">
				<?php echo form_checkbox('public_country',1, $escort->getPublicCountry(), 'class="escort-checkbox"')?>
				</div>
				<div class="three-column-third">
				<?php echo form_checkbox('locked_country',1,$lockedEscort->getLockedCountry(), 'class="escort-checkbox"')?>
				</div>
			</div>
		</li>
		<li class="" id="personal_last_payment">
			<label for="escort_birthday"><?php echo lang('escort_be_escort_personal_state_label')?></label>
			<div class="input type-text three-column">
				<div class="three-column-first">
				<?php echo form_dropdown('state_id', getStateData_ioc($escort->getCountryId()), array($escort->getStateId()), 'id="state_id" class="custom"');?>
				</div>
				<div class="three-column-second">
				&nbsp;
				</div>
				<div class="three-column-third">
				&nbsp;
				</div>
			</div>
		</li>
		<li class="" id="provice_id_wrapper">
			<label for="escort_birthday"><?php echo lang('escort_be_escort_personal_province_label')?></label>
			<div class="input type-text three-column">
				<div class="three-column-first">
				<?php echo form_dropdown('province_id', getProvinceData_ioc($escort->getCountryId(), $escort->getStateId()), array($escort->getProvinceId()), 'id="province_id" class="custom"');?>
				</div>
				<div class="three-column-second">
				&nbsp;
				</div>
				<div class="three-column-third">
				&nbsp;
				</div>
			</div>
		</li>
		<li class="" id="personal_last_payment">
			<label for="escort_birthday"><?php echo lang('escort_be_escort_personal_city_label')?></label>
			<div class="input type-text three-column">
				<div class="three-column-first">
				<?php echo form_dropdown('city_id', getCityData_ioc($escort->getCountryId(), $escort->getStateId(), $escort->getProvinceId()), array($escort->getProvinceId()), 'id="city_id" class="custom"');?>
				</div>
				<div class="three-column-second">
				&nbsp;
				</div>
				<div class="three-column-third">
				&nbsp;
				</div>
			</div>
		</li>
		<li class="" id="personal_profession">
			<label for="escort_birthday"><?php echo lang('escort_be_escort_personal_profession_label')?></label>
			<div class="input type-text three-column">
				<div class="three-column-first">
				<?php echo form_dropdown('profession_id', getProfessionData_ioc(), array($escort->getProfessionId()) , 'id="profession_id" class="custom"' );?>
				</div>
				<div class="three-column-second">
				<?php echo form_checkbox('public_profession',1, $escort->getPublicProfession(), 'class="escort-checkbox"')?>
				</div>
				<div class="three-column-third">
				<?php echo form_checkbox('locked_profession',1,$lockedEscort->getLockedProfession(), 'class="escort-checkbox"')?>
				</div>
			</div>
		</li>
		
		<li class="" id="personal_profession">
			<label for="escort_birthday"><?php echo language_translate('borncountry_label');?></label>
			<div class="input type-text three-column">
				<div class="three-column-first">
				<?php echo form_dropdown('borncountry_id', getBornCountryData_ioc(), array($escort->getBornCountryId()) , 'id="borncountry_id" class="custom"' );?>
				</div>
				<div class="three-column-second">
				<?php echo form_checkbox('public_borncountry',1, $escort->getPublicBorncountry(), 'class="escort-checkbox"')?>
				</div>
				<div class="three-column-third">
				<?php echo form_checkbox('locked_borncountry',1,$lockedEscort->getLockedBornCountry(), 'class="escort-checkbox"')?>
				</div>
			</div>
		</li>
		
		<?php if(!empty($language_array)):
		$language_array = array_filter( explode(',',$escort->getLanguageIds()) );
		$languageOptionArray = getLanguagesOptionData_ioc();
		?>
		<li class="" id="personal_last_payment">
			<div id="escort-description">
				<ul class="tab-menu">
					<?php foreach($language_array as $item):?>
						<li><a href="#des-tabs-lang-<?php echo $item;?>"><?php echo $languageOptionArray[$item];?></a></li>
					<?php endforeach; ?>
				</ul>
				<?php foreach($language_array as $item):?>
					<div id="des-tabs-lang-<?php echo $item;?>">
						<textarea rows="4" cols="20" name="language_<?php echo $item;?>"><?php echo $escort->getDescription($item,$escort->getId());?></textarea>
					</div>
				<?php endforeach; ?>
			</div>
		</li>
		<?php endif; ?>
<script>
	var descTabs = jQuery('#escort-description').tabs({
		cache: true
	});
</script>
	</ul>
	<?php echo form_button(array('id'=>'save-personal-info', 'onClick'=>'savePersionalInfo()','name'=>'add', 'class'=>'btn blue', 'value'=>lang('escort_be_escort_personal_save_label'), 'content'=>lang('escort_be_escort_personal_save_label')))?>
</fieldset>
<?php echo form_close()?>
<script>
jQuery(document).ready(function(){
	jQuery("#birth_date").datepicker({dateFormat: 'dd-mm-yy'});
	jQuery("#country_id").change(function(){
		id = jQuery(this).attr('id');
		jQuery("select#state_id").html('');
		jQuery("select#state_id").trigger("liszt:updated");
		jQuery("select#province_id").html('');
		jQuery("select#province_id").trigger("liszt:updated");
		jQuery("select#city_id").html('');
		jQuery("select#city_id").trigger("liszt:updated");
		
		country_id = jQuery(this).val();
		jQuery.post("./admin/be_escort/get_state_data", { country_id: jQuery(this).val()},
			function(data){
				if(data.spain){
					jQuery("#provice_id_wrapper").css("display", "block");
				}else{
					jQuery("#provice_id_wrapper").css("display", "none");
				}
				jQuery("select#state_id").html(data.data);
				jQuery("select#state_id").trigger("liszt:updated");
			}, "json");
	});
	
	jQuery("#state_id").change(function(){
		country_id = jQuery("#country_id").val();
		state_id = jQuery(this).val();
		jQuery.post("./admin/be_escort/get_city_data", { country_id: country_id, state_id: state_id},
			function(data){
				if(data.spain){
					jQuery("select#province_id").html(data.data);
					jQuery("select#province_id").trigger("liszt:updated");
					jQuery("#province_id").css("display", "block");
				}else{
					jQuery("select#city_id").html(data.data);
					jQuery("select#city_id").trigger("liszt:updated");
				}
			}, "json");
	});
	jQuery("#province_id").change(function(){
		id = jQuery(this).attr('id');
		country_id = jQuery("#country_id").val();
		state_id = jQuery("#state_id").val();
		province_id = jQuery(this).val();
		jQuery.post("./admin/be_escort/get_spain_city_data", { country_id: country_id, state_id: state_id, province_id: province_id},
			function(data){
				jQuery("select#city_id").html(data.data);
				jQuery("select#city_id").trigger("liszt:updated");
			}, "json");
	});
	changeSexOption($('#personal_info_sex_id').val());
});
function changeSexOption(id){
	jQuery('#female_info,#male_info').hide();
	if(id == <?php echo SEX_OPTION_FEMALE_ID;?>){
		jQuery('#female_info').show();
	}
	if(id == <?php echo SEX_OPTION_MALE_ID;?>){
		jQuery('#male_info').show();
	}
}
</script>